package cn.yuxiaoyuan.article.doamin;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

@Data
@Document(collection = "article")//实体类对应mongodb的表/文档article
public class BlogArticle {
    @Id //对应mongodb的表的_id，添加时不设置_id会自动增长
    private String _id;

    private Long id;
    private String articlePic;
    private String articleName;
    private String articleTag;
    private Long articleType;
    private Integer articleState;
    private Integer topState;
    private Long publishId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    private Integer articleReadCount;
    private Integer articleStarNum;
    private Integer articleCommentNum;
    private String articleRemark;
}